Skip to content

security: SQLi and XSS hardening (main) - #319

Open
somethingwithproof wants to merge 3 commits into
Cacti:mainfrom
somethingwithproof:security/backport-all-hardening-main
Open

security: SQLi and XSS hardening (main)#319
somethingwithproof wants to merge 3 commits into
Cacti:mainfrom
somethingwithproof:security/backport-all-hardening-main

Conversation

@somethingwithproof

Copy link
Copy Markdown
Contributor

Implements prepared statements for SQL alerts and systematic HTML escaping for syslog statistics to prevent SQLi and stored XSS. Addresses VULN-008 and VULN-009.

Copilot AI review requested due to automatic review settings April 11, 2026 22:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the syslog plugin against SQL injection in alert evaluation and reduces stored-XSS risk when rendering syslog statistics, aligning with VULN-008 / VULN-009.

Changes:

  • Converted several syslog alert match queries to use prepared statements with bound parameters.
  • Added a syslog_db_fetch_assoc_prepared() wrapper to run prepared SELECTs against the syslog DB connection.
  • Escaped host/program values when rendering the statistics table.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
syslog.php Escapes host/program output in the statistics table rendering.
syslog_process.php Reworks alert match SQL to use parameter binding and prepared fetch helpers.
database.php Adds a prepared-query wrapper for associative fetches on the syslog DB connection.

Comment thread syslog_process.php
Comment thread syslog.php Outdated
Comment thread database.php Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants